import pinia from '@/store'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore(pinia)
export const hasGranted = (app: any) => {

  app.directive('permission', {

    mounted(el: any, options: any) {
      const flag =
        userStore.userState.userInfo &&
        !userStore.userState.userInfo.auths.includes(options.value)
      console.log(flag)
      if (flag) {
        el.parentNode.removeChild(el)
      }
    },
  })
}
